//
//  UIView+Extenssion.m
//  02weiBo
//
//  Created by jss on 16/4/24.
//  Copyright © 2016年 jss. All rights reserved.
//

#import "UIView+Extenssion.h"

@implementation UIView (Extenssion)

-(void)setBorderWidth:(CGFloat)borderWidth {
    
    self.borderWidth = borderWidth;
    
    self.layer.borderWidth = borderWidth;
}
-(CGFloat)borderWidth {
    
    return self.layer.borderWidth;
}


-(void)setBorderColor:(UIColor *)borderColor {
    
    self.borderColor = borderColor;
    self.layer.borderColor = (__bridge CGColorRef _Nullable)(borderColor);
}

-(UIColor *)borderColor{
    return [UIColor colorWithCGColor:self.layer.borderColor];
}

-(void)setCornerRadiu:(CGFloat)cornerRadiu {
    
    self.cornerRadiu = cornerRadiu;
    self.layer.cornerRadius = cornerRadiu;
    self.layer.masksToBounds = (cornerRadiu > 0);
}

-(CGFloat)cornerRadiu{
    return self.layer.cornerRadius;
}
@end
